<?php
namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Lib\Response;
use App\Http\Model\Hint;
use App\Http\Services\FeedbackServices;

class FeedbackController extends BaseController
{
    private $feedback_service;

    public function __construct()
    {
        $this->feedback_service = new FeedbackServices();
    }

    /**
     * @desc 问题反馈
     * */
    public function feedbackAdd(Request $request)
    {
        $content = $request->post("content");
        $imgs = $request->post("imgs");
        if(empty($content)) {
            Response::returnResult(Hint::PARAM_ERROR);
        }
        $userId = $this->getLoginUserId();
        if(empty($userId)) {
            Response::returnResult(Hint::LOGIN_OUT);
        }

        $this->feedback_service->feedbackAdd($userId, $content, $imgs);

        Response::returnResult(Hint::SUCCESS);
    }

    
    
}
